-
Notifications
You must be signed in to change notification settings - Fork 8k
drivers: comparator: Add Comparator support on Renesas RX #93694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
drivers: comparator: Add Comparator support on Renesas RX #93694
Conversation
The following west manifest projects have changed revision in this Pull Request:
⛔ DNM label due to: 1 project with PR revision Note: This message is automatically posted and updated by the Manifest GitHub Action. |
6018f8c
to
c11e903
Compare
c11e903
to
d012894
Compare
32de31c
to
7f1fb14
Compare
59e026a
to
b71daf0
Compare
this is literally the 3rd PR I looked at in 15 minutes where NXP maintainer got pulled in despite no NXP files, please fix the MAINTAINER.yml |
@@ -0,0 +1,271 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@quytranpzz , This file name should be comparator_renesas_rx_lvd.c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's done. I updated the file name
drivers/comparator/CMakeLists.txt
Outdated
zephyr_library_sources_ifdef(CONFIG_COMPARATOR_NRF_LPCOMP comparator_nrf_lpcomp.c) | ||
zephyr_library_sources_ifdef(CONFIG_COMPARATOR_SHELL comparator_shell.c) | ||
zephyr_library_sources_ifdef(CONFIG_COMPARATOR_RENESAS_RA comparator_renesas_ra.c) | ||
zephyr_library_sources_ifdef(CONFIG_COMPARATOR_RENESAS_RX_LVD comparator_renesas_rx.c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@quytranpzz , Please change file name to comparator_renesas_rx_lvd.c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's done
#define LVD_IRQ_CONNECT() \ | ||
do { \ | ||
IF_ENABLED(DT_NODE_HAS_STATUS_OKAY(LVD0_NODE), ( \ | ||
IRQ_CONNECT(DT_IRQN(LVD0_NODE), \ | ||
DT_IRQ(LVD0_NODE, priority), \ | ||
lvd_ch1_isr, \ | ||
DEVICE_DT_GET(LVD0_NODE), \ | ||
0); \ | ||
irq_enable(DT_IRQN(LVD0_NODE)); \ | ||
)) \ | ||
IF_ENABLED(DT_NODE_HAS_STATUS_OKAY(LVD1_NODE), ( \ | ||
IRQ_CONNECT(DT_IRQN(LVD1_NODE), \ | ||
DT_IRQ(LVD1_NODE, priority), \ | ||
lvd_ch2_isr, \ | ||
DEVICE_DT_GET(LVD1_NODE), \ | ||
0); \ | ||
irq_enable(DT_IRQN(LVD1_NODE)); \ | ||
)) \ | ||
} while (0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@quytranpzz , I think it would be better to add this as static inline function
e.g.
static inline void lvd_irq_connect(void)
{
#if DT_NODE_HAS_STATUS_OKAY(LVD0_NODE)
IRQ_CONNECT(DT_IRQN(LVD0_NODE), DT_IRQ(LVD0_NODE, priority), lvd_ch1_isr, DEVICE_DT_GET(LVD0_NODE), 0);
irq_enable(DT_IRQN(LVD0_NODE));
#endif
#if DT_NODE_HAS_STATUS_OKAY(LVD1_NODE)
IRQ_CONNECT(DT_IRQN(LVD1_NODE), DT_IRQ(LVD1_NODE, priority), lvd_ch2_isr, DEVICE_DT_GET(LVD1_NODE), 0);
irq_enable(DT_IRQN(LVD1_NODE));
#endif
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I have updated it as a static inline function
Update the latest commit ID for HAL Renesas Signed-off-by: Quy Tran <[email protected]>
Add comparator support for Renesas RX with LVD Signed-off-by: Quy Tran <[email protected]>
Add DTS node for LVD support on RX130 Signed-off-by: Quy Tran <[email protected]>
Add a simple sample using Comparator API to monitor the voltage on Renesas boards Signed-off-by: Quy Tran <[email protected]>
b71daf0
to
c49bac7
Compare
|
Add comparator driver support on Renesas RX130 using LVD peripheral.
This driver uses a voltage threshold as the negative input, while the positive input can be selected between Vcc or the CMPA pin.